package com.sngamelib.topdownshooter;

public class DefenseModule
{
	private int hpPool;
	private AspectType aspectType;
	private Group<AspectModifier> dmgTypeModifiers;
	
	DefenseModule()
	{
		hpPool = 0;
		aspectType = null;
		dmgTypeModifiers = new Group<AspectModifier>();
	}
	
	DefenseModule(int _hpp, AspectType _as)
	{
		hpPool = _hpp;
		aspectType = _as;
		dmgTypeModifiers = new Group<AspectModifier>();
	}
	
	DefenseModule(int _hpp, AspectType _as, int _size)
	{
		hpPool = _hpp;
		aspectType = _as;
		dmgTypeModifiers = new Group<AspectModifier>();
		dmgTypeModifiers.setSize(_size);
	}
	
	DefenseModule(DefenseModule _dm)
	{
		hpPool = _dm.getHpPool();
		aspectType = _dm.getAspectType();
		
		int count = 0;
		while (count < _dm.getModifierCount())
		{
			dmgTypeModifiers.Add(_dm.getModifier(count));
			count++;
		}
	}
	
	public int getHpPool()
	{
		return hpPool;
	}
	
	public AspectType getAspectType()
	{
		return aspectType;
	}
	
	public void setHpPool(int _hpp)
	{
		hpPool = _hpp;
	}
	
	public void setAspectType(AspectType _at)
	{
		aspectType = _at;
	}
	
	public AspectModifier getModifier(int _index)
	{
		return dmgTypeModifiers.Get(_index);
	}
	
	public AspectModifier getModifier(AspectModifier _am)
	{
		return dmgTypeModifiers.Get(_am);
	}
	
	public int getModifierCount()
	{
		return dmgTypeModifiers.getSize();
	}
	
	public int addModifier(AspectModifier _am)
	{
		return dmgTypeModifiers.Add(_am);
	}
	
	public void setModifier(int _index, AspectModifier _am)
	{
		dmgTypeModifiers.Set(_index, _am);
	}
	
	public boolean remModifier(AspectModifier _am)
	{
		return dmgTypeModifiers.Remove(_am);
	}
	
	public boolean remModifierAt(int _index)
	{
		return dmgTypeModifiers.RemoveAt(_index);
	}
}
